<?php

/**
 * @version			$Id$
 * @create 			2016-03-13 10:03:18 By xjiujiu
 * @description     HongJuZi Framework
 * @copyRight 		Copyright (c) 2011-2012 http://www.xjiujiu.com.All right reserved
 */
defined('_HEXEC') or die('Restricted access!');

//导入引用文件
HClass::import('config.popo.areapopo, app.admin.action.AdminAction, model.areamodel');

/**
 * 市县区的动作类 
 * 
 * 主要处理后台管理主页的相关请求动作 
 * 
 * @author 			xjiujiu <xjiujiu@foxmail.com>
 * @package 		app.admin.action
 * @since 			1.0.0
 */
class AreaAction extends AdminAction
{

    /**
     * 构造函数 
     * 
     * 初始化类变量 
     * 
     * @access public
     */
    public function __construct() 
    {
        parent::__construct();
        $this->_popo        = new AreaPopo();
        $this->_model       = new AreaModel($this->_popo);
    }
    
    /**
     * 列表加截
     * 
     * @access public
     */
    public function alist()
    {
        HVerify::isAjax();
        $pId    = HVerify::isEmptyByVal(HRequest::getParameter('pid'), '省份');
        $list   = $this->_model->getAllRowsByFields('`id`, `name`', '`parent_id` = ' . $pId);

        HResponse::json(array('rs' => true, 'data' => $list));
    }

}

?>
